﻿using BlogDemo.Common;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Text;

namespace BlogDemo.Core.Domain
{
    public class Post : EntityBase<int>
    {
        public string Title { get; set; }

        public string Body { get; set; }

        public string Author { get; set; }

        public string Remark { get; set; }

        public DateTime CreateAt { get; set; }
       
        //[ForeignKey("BlogId")]
        //public int BlogId { get; set; }
        public Blog Blog { get; set; }

        public virtual ICollection<PostTag> PostTags { get; set; }

        // 多对多 1，无中间Model
        // public virtual ICollection<Tag> Tags { get; set; }
        public virtual ICollection<Comment> Comments { get; set; }
        public Post()
        {
            PostTags = new List<PostTag>();

            Comments =new List<Comment>();
        }

    }
}
